package org.gnyxy.mapper;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.gnyxy.dto.PageQueryDTO;
import org.gnyxy.entity.Type;
import org.gnyxy.vo.TypeVO;

import java.util.List;

@Mapper
public interface TypeMapper {
    @Insert("insert into type (name, image, status, deleted) VALUES " +
            "(#{name},#{image},#{status},#{deleted})")
    void insert(Type type);

    Page<Type> pageQuery(PageQueryDTO pageQueryDTO);

    @Select("select * from type where deleted = 0 and id = #{id}")
    Type getById(Long id);

    void update(Type type);

    List<Type> getTrueStatus(String name);

    @Select("select * from type where deleted = 0 and status = 1")
    List<Type> getType();
}
